package com.ruoyi.web.controller.durian.task;

import com.ruoyi.durian.service.LlCardPackageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component("couponTask")
public class CouponTask {

    @Resource
    private LlCardPackageService llCardPackageService;

    private static final Logger LOGGER = LoggerFactory.getLogger(CouponTask.class);

    /**
     * 定时任务检查失效优惠券
     */
    public void checkLoseEfficacyCoupon() {
        LOGGER.info("开始执行失效优惠券检查！！！》》》》");
        if (llCardPackageService.checkLoseEfficacyCoupon()) {
            LOGGER.info("发现失效优惠进行修改！！！》》》》");
            return;
        }
        LOGGER.info("未发现失效优惠！！！》》》》");
    }
}
